<?php
/**
 * Created by PhpStorm.
 * User: 低调
 * Date: 2018/5/22
 * Time: 20:54
 */
//normalUser
header("Content-type:text/html;charset:utf8");
include("../connectdb.php");
session_start();
$id = $_SESSION['id'];
if($_SESSION == NULL){
    echo "<script>location.href='../index/404.php';</script>";
}
$sql = "SELECT * FROM normalUser WHERE `id`='$id'";
$result = mysqli_fetch_array(mysqli_query($conn,$sql));
if(!$result){
    echo "<script>location.href='404.php';</script>";
}
?>


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>个人 主页</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="../admin/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="../admin/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <script src="../admin/assets/js/echarts.min.js"></script>
    <link rel="stylesheet" href="../admin/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="../admin/assets/css/amazeui.datatables.min.css" />
    <link rel="stylesheet" href="../admin/assets/css/app.css">
    <script src="../admin/assets/js/jquery.min.js"></script>
    <style>
        a:hover{color: #21ff3a; text-decoration: none;}
    </style>
</head>

<body data-type="index">
<script src="../admin/assets/js/theme.js"></script>
<SCRIPT language=JavaScript>
    function Checkpost(){
        if (form1.title.value==""){
            alert("标题不能为空");
            form1.title.focus();
            return false;
        }
        if(form1.content.value==""){
            alert("内容不能为空");
            form1.content.focus();
            return false;
        }
    }
</SCRIPT>
<div class="am-g tpl-g">
    <!-- 头部 -->
    <header>
        <!-- logo -->
        <div class="am-fl tpl-header-logo">
            <a href="javascript:;"><img src="../admin/assets/img/logo.png" alt=""></a>
        </div>
        <!-- 右侧内容 -->
        <div class="tpl-header-fluid">
            <!-- 侧边切换 -->
            <div class="am-fl tpl-header-switch-button am-icon-list">
                    <span>

                </span>
            </div>

            <!-- 其它功能-->
            <div class="am-fr tpl-header-navbar">
                <ul>
                    <!-- 欢迎语 -->
                    <li class="am-text-sm tpl-header-navbar-welcome">
                        <a href="javascript:;">欢迎你, <span><?php echo $result['username'];?></span> </a>
                    </li>

                    <!-- 新邮件 -->
                    <li class="am-dropdown tpl-dropdown" data-am-dropdown>
                        <a href="javascript:;" class="am-dropdown-toggle tpl-dropdown-toggle" data-am-dropdown-toggle>
                            <i class="am-icon-envelope"></i>
                            <span class="am-badge am-badge-success am-round item-feed-badge">1</span>
                        </a>
                        <!-- 弹出列表 -->
                        <ul class="am-dropdown-content tpl-dropdown-content">
                            <li class="tpl-dropdown-menu-messages">
                                <a href="javascript:;" class="tpl-dropdown-menu-messages-item am-cf">
                                    <div class="menu-messages-ico">
                                        <img src="../admin/assets/img/user04.png" alt="">
                                    </div>
                                    <div class="menu-messages-time">
                                        3小时前
                                    </div>
                                    <div class="menu-messages-content">
                                        <div class="menu-messages-content-title">
                                            <i class="am-icon-circle-o am-text-success"></i>
                                            <span>新邮件</span>
                                        </div>
                                        <div class="am-text-truncate"> 欢迎使用个人博客管理系统 </div>
                                        <div class="menu-messages-content-time">2018-05-19 下午 21:25</div>
                                    </div>
                                </a>
                            </li>

                            <li class="tpl-dropdown-menu-messages">
                                <a href="javascript:;" class="tpl-dropdown-menu-messages-item am-cf">
                                    <i class="am-icon-circle-o"></i> 进入列表…
                                </a>
                            </li>
                        </ul>
                    </li>

                    <!-- 新提示 -->
                    <li class="am-dropdown" data-am-dropdown>
                        <a href="javascript:;" class="am-dropdown-toggle" data-am-dropdown-toggle>
                            <i class="am-icon-bell"></i>
                            <span class="am-badge am-badge-warning am-round item-feed-badge">0</span>
                        </a>

                        <!-- 弹出列表 -->
                        <ul class="am-dropdown-content tpl-dropdown-content">

                            <li class="tpl-dropdown-menu-notifications">
                                <a href="javascript:;" class="tpl-dropdown-menu-notifications-item am-cf">
                                    <i class="am-icon-bell"></i> 进入列表…
                                </a>
                            </li>
                        </ul>
                    </li>

                    <!-- 退出 -->
                    <li class="am-text-sm">
                        <a href="../index/loginout.php">
                            <span class="am-icon-sign-out"></span> 退出
                        </a>
                    </li>
                </ul>
            </div>
        </div>

    </header>
    <!-- 风格切换 -->
    <div class="tpl-skiner">
        <div class="tpl-skiner-toggle am-icon-cog">
        </div>
        <div class="tpl-skiner-content">
            <div class="tpl-skiner-content-title">
                选择主题
            </div>
            <div class="tpl-skiner-content-bar">
                <span class="skiner-color skiner-white" data-color="theme-white"></span>
                <span class="skiner-color skiner-black" data-color="theme-black"></span>
            </div>
        </div>
    </div>
    <!-- 侧边导航栏 -->
    <div class="left-sidebar">
        <!-- 用户信息 -->
        <div class="tpl-sidebar-user-panel">
            <div class="tpl-user-panel-slide-toggleable">
                <div class="tpl-user-panel-profile-picture">
                    <img src="../admin/assets/img/user04.png" alt="">
                </div>
                <span class="user-panel-logged-in-text">
              <i class="am-icon-circle-o am-text-success tpl-user-panel-status-icon"></i>
              用户：<?php echo $_SESSION['username']?>
          </span>
            </div>
        </div>

        <!-- 菜单 -->
        <ul class="sidebar-nav">
            <li class="sidebar-nav-link">
                <a href="index.php" class="active">
                    <i class="am-icon-home sidebar-nav-link-logo"></i> 首页
                </a>
            </li>

            <li class="sidebar-nav-link">
                <a href="javascript:;" class="sidebar-nav-sub-title">
                    <i class="am-icon-table sidebar-nav-link-logo"></i> 文章管理
                    <span class="am-icon-chevron-down am-fr am-margin-right-sm sidebar-nav-sub-ico"></span>
                </a>
                <ul class="sidebar-nav sidebar-nav-sub">
                    <li class="sidebar-nav-link">
                        <a href="add.php">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 发表文章
                        </a>
                    </li>
                    <li class="sidebar-nav-link">
                        <a href="articleList.php">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 所有文章
                        </a>
                    </li>
                    <li class="sidebar-nav-link">
                        <a href="selfArticleList.php">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 仅自己可见
                        </a>
                    </li>
                </ul>
            </li>

            <li class="sidebar-nav-link">
                <a href="information.php">
                    <i class="am-icon-wpforms sidebar-nav-link-logo"></i> 个人信息

                </a>
            </li>

            <li class="sidebar-nav-link">
                <a href="login.php">
                    <i class="am-icon-tv sidebar-nav-link-logo"></i> 切换账户
                </a>
            </li>

            <li class="sidebar-nav-link">
                <a href="register.php">
                    <i class="am-icon-clone sidebar-nav-link-logo"></i> 注册新账户

                </a>
            </li>

            <li class="sidebar-nav-link">
                <a href="forget.php">
                    <i class="am-icon-key sidebar-nav-link-logo"></i> 修改密码
                </a>
            </li>

            <li class="sidebar-nav-link">
                <a href="../index/loginout.php">
                    <i class="am-icon-sign-out"></i> 退出
                </a>
            </li>

        </ul>
    </div>
</div>
<script src="../admin/assets/js/amazeui.min.js"></script>
<script src="../admin/assets/js/amazeui.datatables.min.js"></script>
<script src="../admin/assets/js/dataTables.responsive.min.js"></script>
<script src="../admin/assets/js/app.js"></script>

</body>

</html>